<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>作息时间信息</title>
<link rel="icon" href="<c:url value='/imgs/logo.ico' />" />
<link type="text/css" rel="stylesheet" href="<c:url value='/css/index.css' />" />
<link type="text/css" rel="stylesheet" href="<c:url value='/css/list.css' />" />
<script type="text/javascript" charset="utf-8" src="<c:url value='/scripts/jquery-2.1.0.js'/>"></script>
<script charset="utf-8" src="<c:url value='/scripts/laydate.js' />"></script>
</head>
<body>
	<div class="container">
		<%@ include file="/jsps/top.jsp"%>
		<div class="main">
			<div class="content">
				<h2>作息时间信息</h2>
				<div class="fun">
					<input id="date" class="query" type="text" name="daydate" placeholder="请输入查询的日期" /><input class="searchBtn" type="button" value="搜索"/>
					<input class="addBtn" type="button" value="添加作息"/>
					<input type="hidden" name="mechid" value="${mechid }"/>
				</div>
				<table class="listTable daytime">
					<tr class="listTitle">
						<td>机构号</td>
						<td>作息类型</td>
						<td>开始日期</td>
						<td>结束日期</td>
						<td>上班时间</td>
						<td>下班时间</td>
					</tr>
					<c:forEach items="${pb.beanList }" var="daytime">
					<tr>
						<td class="mechid">${daytime.mechanism.mechid }</td>
						<td>${daytime.daytype }</td>
						<td>${daytime.daybdate }</td>
						<td>${daytime.dayedate }</td>
						<td>${daytime.begintime }</td>
						<td>${daytime.endtime }</td>
					</tr>
					<input type="hidden" name="mechid" value="${daytime.mechanism.mechid }" />
					</c:forEach>
				</table>
				<%@ include file="/jsps/page.jsp"%>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			//日期范围
			laydate.render({
			  elem: '#date'
			});
			
			$(".top .title").click(function(){
				location.href="<c:url value='/index.jsp'/>";
			});	
			
			var mechid = $("input[name='mechid']").val();
			$(".main .fun .searchBtn").click(function(){
				var date = $("input[name='daydate']").val();
				window.location.href="/FaceAttendSystem/queryDaytime?type=1&mechid="+mechid+"&date="+date+"&pc=1";
			});
			
			$(".main .fun .addBtn").click(function(){
				window.location.href="/FaceAttendSystem/queryDaytime?type=2&mechid="+mechid;
			});
		});
	</script>
</body>
</html>

